

const postModel = require('../models/post')
async function getPostsTitleInfo(categoryId) {
    let query = categoryId === 'all' ? {} : {categoryId: categoryId}
    let data
    await postModel.getPostsTitleInfo(query)
            .then(info => {
                data = info
            })
            .catch(error => {
                console.log(error)
            })
    return data
}

module.exports = {
    getPostsTitleInfo
}